package com.muchfish.reactor.api;

import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

public class ReactorZipExample {
    public static void main(String[] args) {
        Mono<String> mono1 = Mono.just("Hello");
        Mono<String> mono2 = Mono.just("Reactor");

        // 将两个 Mono 合并为一个 Flux
        Flux<String> result = Flux.zip(mono1, mono2)
                .map(tuple -> tuple.getT1() + " " + tuple.getT2());

        result.subscribe(System.out::println); // 输出: Hello Reactor
    }
}
